﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace EShop.Models
{
    [Bind(Exclude = "GoodsId")]
    public class Goods
    {
        [ScaffoldColumn(false)]
        public int GoodsId { get; set; }

        [DisplayName("分类")]
        public int GenreId { get; set; }

        [DisplayName("品牌")]
        public int brandId { get; set; }

        [Required(ErrorMessage = "输入名称")]
        [StringLength(160)]
        public string Name { get; set; }

        [Required(ErrorMessage = "输入价格")]
        [Range(0.01, 100.00,
            ErrorMessage = "价格介于0.01-100.00")]
        public decimal Price { get; set; }

        [DisplayName("图片地址")]
        [StringLength(1024)]
        public string GoodsUrl { get; set; }

        public virtual Genre Genre { get; set; }
        public virtual brand brand { get; set; }
        public virtual List<OrderDetail> OrderDetails { get; set; }
    }
}